<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
	die ('Please do not load this page directly. Thanks!');

if (!empty($post->post_password)) { // if there's a password
	if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {	// and it doesn't match the cookie
?>

							<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

<?php
		return;
	}
}

// You can start editing here.

if ($comments || 'open' == $post->comment_status) { ?>
							<h3 id="comments" class="clearleft"><?php comments_number('No Responses Yet', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3><?php } ?>
							
<?php if ($comments) : ?>

							<ol class="commentlist">

<?php foreach ($comments as $comment) : ?>

								<li <?php userlevel_highlight_class(); ?>id="comment-<?php comment_ID() ?>"><?php gravatar(); ?>
									<cite><?php comment_author_link() ?></cite> <?php commentword() ?> on <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date(get_option('date_format')) ?> at <?php comment_time() ?></a> <?php edit_comment_link('Edit this comment','&nbsp;&nbsp;[',']'); ?></small> :
									<br />
									<?php if ($comment->comment_approved == '0') : ?><em>Your comment is awaiting moderation.</em><?php endif; ?>

									<?php comment_text() ?>

								</li>

<?php endforeach; /* end for each comment */ ?>
							</ol>
<?php else : // this is displayed if there are no comments so far ?>
<?php endif; ?>
<?php global $trackbacks; 
if ($trackbacks) :
$comments = $trackbacks; ?>
							<h3 id="trackbacks"><?php if (countTrackbacks()) { echo countTrackbacks(); ?> Trackback<?php if (countTrackbacks() > 1) echo "s"; } ?> <?php if (countPingbacks()) { echo countPingbacks(); ?> Pingback<?php if (countPingbacks() > 1) echo "s"; } ?></h3>
							<ol class="commentlist">
<?php foreach ($comments as $comment) : ?>
								<li class="trackback">
									<?php if ($comment->comment_type == 'pingback') echo 'Pingback from';
elseif ($comment->comment_type == 'trackback') echo 'Trackback from'; ?> <cite><?php comment_author_link() ?></cite> on <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date(get_option('date_format')) ?> at <?php comment_time() ?></a> <?php edit_comment_link('Edit this '.$comment->comment_type,'&nbsp;&nbsp;[',']'); ?></small> :
									<br />

									<?php comment_text(); ?>

								</li>
<?php endforeach; /* end for each comment */ ?>
							</ol>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
							<ol class="commentlist">
								<li <?php global $user_email, $user_identity, $user_level;
userlevel_highlight_class(true);
get_currentuserinfo();
?>id="commentpreview" style="display:none"><?php gravatar_email($user_email); ?><cite id="commentpreview_author"><?php echo $user_identity; ?></cite> <?php commentword() ?> on <small class="commentmetadata"><a href="#commentpreview" title=""><?php echo date(get_option('date_format')); ?> at <?php echo date(get_option('time_format')); ?></a></small> :
									<br />
									<em>This is only a preview<?php if ($trackbacks) { ?>, when you submit this comment, it will be shown above the trackbacks and pingbacks<?php } ?>.</em>
									<div id="commentpreview_message">
										
									</div>
									<script type="text/javascript">
									var defaultgravatar = "<?php echo urlencode(get_bloginfo('template_directory').'/images/'.template_color().'/comment-gravatar.jpg'); ?>";
									var usegravatars = <?php global $show_gravatars; if ($show_gravatars == 'true') echo 'true'; else echo 'false'; ?>;
									var dateformat = "<?php echo str_replace("\\", "\\\\", get_option('date_format')); ?>";
									var timeformat = "<?php echo str_replace("\\", "\\\\", get_option('time_format')); ?>";
								</script>
									<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/commentpreview.js"></script>
								</li>
							</ol>
							<div class="clear"></div>
							<h3 id="respond">Leave a Reply</h3>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
							<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

							<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $user_ID ) : ?>

								<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a><input type="hidden" id="author" value="<?php echo $user_identity; ?>" /><input type="hidden" id="email" value="<?php echo $user_email; ?>" /><input type="hidden" id="url" value="<?php echo $user_url; ?>" /></p>

<?php else : ?>

								<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" onkeyup="commentcheck()" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

								<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" onkeyup="commentcheck()" />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

								<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" onkeyup="commentcheck()" />
<label for="url"><small>Website</small></label></p>

<?php endif; ?>
								<p class="postmetadata">
									<textarea name="comment" id="comment" cols="74" rows="10" tabindex="4" onkeyup="commentcheck()"></textarea><br />
									<input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
									<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
									<?php do_action('comment_form', $post->ID); ?></p>
</form>

<?php endif; // If registration required and not logged in ?>

<?php endif; // if you delete this the sky will fall on your head ?>
